home *** CD-ROM | disk | FTP | other *** search
/ Know Your Hockey - The Greatest Player Resource / Know Your Hockey: The Greatest Player Resource.iso / hockey / director / ssqcst.cst / 00011_Script_ButtonKit < prev    next >
Text File  |  1998-09-28  |  4KB  |  135 lines

  1.  
  2. ------------------ Init List For Button State Tracking --------------------
  3.  
  4. -- called from on startmovie or the first exitframe script in the movie
  5. -- loads a default list of 0
  6. -- the list is used by ButtonKit to set the positions to 1 to
  7. -- track which buttons are on or off
  8.  
  9. global gButtonState,gHion,gOpning
  10.  
  11. on initButtonKit
  12.   set gButtonState = []
  13.   repeat with x = 1 to 48
  14.     append gbuttonState,0
  15.   end repeat  
  16. end
  17.  
  18. ------------------- Three State Button --------------------------------------
  19.  
  20. -- if a button has three states then call ThreeStateButton as the first line in any scripts
  21. -- that are attached to the button
  22.  
  23. on ThreeStateButton
  24.   set gOpning = EMPTY
  25.   set mybutton = the clickon
  26.   set one = getat(gbuttonState, mybutton)
  27.   if one = 0 then 
  28.     set the membernum of sprite mybutton = the membernum of sprite mybutton +1
  29.     setat(gbuttonState, mybutton,2) 
  30.   end if
  31. end
  32.  
  33.  
  34.  
  35. -------------------------- Two State Buttons --------------------------
  36.  
  37. -- if a button has two states then call TwoStateButton as the first line in any scripts
  38. -- that are attached to the button
  39.  
  40. on TwoStateButton
  41.   set gOpning = EMPTY
  42.   set mybutton = the clickon
  43.   setat(gButtonState,mybutton,1)
  44. end
  45.  
  46.  
  47. ------------------------- Reset Button States -----------------------------------
  48.  
  49. -- toggles off any button that any ready on 
  50. -- these scripts are placed in the second line of a button handler
  51. -- after ThreeStateButton or twostatebutton
  52. -- they are divided into groups attach the correct group to you handler
  53.  
  54.  
  55. -- attach to VCR buttons
  56. on resetVCR
  57.   set mybutton = the clickon
  58.   repeat with y = 20 to 24
  59.     set thisone = getat(gbuttonState,y)
  60.     if thisone  > 0 and y <> mybutton then  
  61.       set the membernum of sprite y = the membernum of sprite y -1
  62.       setat(gbuttonState,y,0)
  63.       exit
  64.     end if
  65.   end repeat 
  66. end
  67.  
  68. -- attach to pro and Jr Buttons
  69. on resetPro
  70.   set mybutton = the clickon
  71.   repeat with y = 24 to 25
  72.     set thisone = getat(gbuttonState,y)
  73.     if thisone > 0 and y <> mybutton then  
  74.       set the blend of sprite y = 0
  75.       set the membernum of sprite y = the membernum of sprite y -1
  76.       setat(gbuttonState,y,0)
  77.       exit
  78.     end if
  79.   end repeat 
  80. end
  81.  
  82.  
  83. --- attach to players
  84. on resetPlayers
  85.   set mybutton = the clickon
  86.   repeat with y = 11 to 16
  87.     set thisone = getat(gbuttonState,y)
  88.     if thisone > 0 and y <> mybutton then  
  89.       set the blend of sprite y = 0
  90.       set the membernum of sprite y = the membernum of sprite y -1
  91.       setat(gbuttonState,y,0)
  92.       updatestage
  93.     end if
  94.   end repeat 
  95. end
  96.  
  97. -- attach to ButtonBanner
  98. on resetBanner
  99.   if the clickon = 4 then exit -- if you are on the puck slider
  100.   set mybutton = the clickon
  101.   repeat with y = 18 to 23
  102.     set thisone = getat(gbuttonState,y)
  103.     if thisone > 0 and y <> mybutton then  
  104.       set the membernum of sprite y = the membernum of sprite y -1
  105.       setat(gbuttonState,y,0)
  106.       set the blend of sprite y = 0 
  107.       updatestage
  108.     end if
  109.   end repeat 
  110. end
  111.  
  112. -- attach to Icon Cards script
  113. on resetIcons
  114.   set mybutton = the clickon
  115.   repeat with y = 44 to 46
  116.     set thisone = getat(gbuttonState,y)
  117.     if thisone > 0 and y <> mybutton then  
  118.       set the membernum of sprite y = the membernum of sprite y -1 
  119.       setat(gbuttonState,y,0)
  120.       exit
  121.     end if
  122.   end repeat 
  123. end
  124.  
  125. on resetSlider
  126.   set mybutton = the clickon
  127.   repeat with y = 29 to 30
  128.     set thisone = getat(gbuttonState,y)
  129.     if thisone > 0 and y <> mybutton then  
  130.       setat(gbuttonState,y,0)
  131.       updatestage
  132.       exit
  133.     end if
  134.   end repeat 
  135. end